package com.ls.controller.yxsms;

import com.ls.controller.company.model.AddCompanyModel;
import com.ls.controller.company.model.EditCompanyModel;
import com.ls.controller.template.model.QueryTemplateModel;
import com.ls.controller.yxsms.model.AddYxSmsModel;
import com.ls.controller.yxsms.model.EditYxSmsModel;
import com.ls.controller.yxsms.model.QueryYxSmsModel;
import com.ls.service.IYxSmsService;
import com.ls.utils.ResultData;
import io.swagger.annotations.Api;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 5g阅信模板 前端控制器
 * </p>
 *
 * @author pengyu
 * @since 2024-10-12
 */
@Api(value = "5g阅信模板相关接口", tags = "5g阅信模板相关接口")
@RestController
@RequiredArgsConstructor
@RequestMapping("/yxSms")
public class YxSmsController {
    private final IYxSmsService service;
    /**新增*/
    @PostMapping("add")
    public ResultData add(@Valid @RequestBody AddYxSmsModel model) {
        return service.add(model);
    }
    /** 更新  */
    @PostMapping("edit")
    public ResultData edit(@Valid @RequestBody EditYxSmsModel model) {
        return service.edit(model);
    }
    /** 删除  */
    @PostMapping("del")
    public ResultData del(@RequestParam @NotNull(message = "id不得为空") Long yxSmsId) {
        return service.del(yxSmsId);
    }
    /**根据id查询*/
    @GetMapping("getYxSmsById")
    public ResultData getYxSmsById(@RequestParam @NotNull(message = "id不得为空") Long yxSmsId) {
        return service.getYxSmsById(yxSmsId);
    }
    /**
     * 查询5g阅信模板分页列表
     */
    @GetMapping("pageList")
    public ResultData pageList(QueryYxSmsModel model) {
        return service.pageList(model);
    }
}
